InStr() returns the location where one string resides in another string. String functions are one based, not zero based like arrays. Heres an example:
Private Sub cmdInstr_Click ()
Dim strName As String
strName = "Bill Gates"
Me.Cls
Me.Print strName
Me.Print InStr(strName, "G")
Me.Print InStr(strName, "Gates")
End Sub
The first argument you typically pass to the Instr() function is the string you wish to search within. The next parameter is the string you wish to search for. This function will return the numeric location of where the 2nd parameter is located within the first.
InStrRev( )
InStrRev() returns the location where one string resides in another string, but from the end of the string. Heres an example:
Private Sub cmdInstrRev_Click()
Dim strValue As String